package com.hzdesk.media.matvector.koreabatch.client.my_paperless.fragment.Fragment_persenter;

import android.content.Context;
import android.view.View;

import com.hzdesk.media.matvector.koreabatch.client.my_paperless.adapter.DevicesManagerAdapter;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.adapter.DwonlaodAdapter;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.custom_view.MyRecyclerView;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.fragment.fragment_contract.IDwonlaodContract;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.inter.IonClickedItemListenter;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.utils.RecyclerViewUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/8/10.
 * 杭州席媒科技有限公司  Developers  刘传华  10
 * 佛祖镇楼 bug辟易
 */

public class DwonlaodPersenter implements IDwonlaodContract.IDwonlaodPersenter {


    private IDwonlaodContract.IDwonlaodView mIDwonlaodView;
    private DwonlaodAdapter dwonlaodAdapter;

    public DwonlaodPersenter(IDwonlaodContract.IDwonlaodView mIDwonlaodView) {
        this.mIDwonlaodView = mIDwonlaodView;
    }

    @Override
    public void onClickedAllSuspended() {

    }

    @Override
    public void initMyRecyclerView(MyRecyclerView mMyRecyclerView, Context mContext) {
        RecyclerViewUtils mRecyclerViewUtils =   new RecyclerViewUtils();
        dwonlaodAdapter = new DwonlaodAdapter<String>(mContext);
        mRecyclerViewUtils.initView(mMyRecyclerView,0,mContext, dwonlaodAdapter);
        addAdapterDate();
        setDevicesManagerAdapterListener(dwonlaodAdapter);
    }
    /**
     * @desc 向容器中添加数据
     * */
    private void addAdapterDate() {
        List<String> mlist = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            mlist.add("item----"+i);
        }
        dwonlaodAdapter.AddItemDate(mlist);
    }

    /**
     * @desc 设置监听
     * */
    private void setDevicesManagerAdapterListener(DwonlaodAdapter managerAdapter) {
        managerAdapter.setmIonClickedItemListenter(new IonClickedItemListenter() {
            @Override
            public void onClickedItem(View view) {

            }

            @Override
            public void onClickedFist(int postion) {

            }

            @Override
            public void onClickedSecond(int postion) {

            }
        });
    }
}
